@extends('home.layout.layout')
@section('title',"个人资料修改")

@section('con')

<div class="hp-wrap">
    <div class="ibox-content">
        <form id="signupForm" action="{{url('/home/mypage/dataself')}}" method='post' class="form-horizontal m-t" >
            
            <div class="form-group">
                <label class="col-sm-3 control-label">性别: </label>
                <div class="col-sm-5">
                    <label class=" radio-inline">
                        <input type="radio" <?php if($user->sex=='u'){echo 'checked';} ?> value="u" id="optionsRadiosInline1" name="sex">保密
                    </label>
                    <label class="radio-inline">
                        <input type="radio" <?php if($user->sex=='f'){echo 'checked';} ?> value="f" id="optionsRadiosInline2" name="sex">女
                    </label>
                    <label class="radio-inline">
                        <input type="radio" <?php if($user->sex=='m'){echo 'checked';} ?> value="m" id="optionsRadiosInline3" name="sex">男
                    </label>
                </div>    
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">生日：</label>
                <div class="col-sm-5">
                    <input onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" placeholder="年/月/日" class="form-control layer-date" name='birth' value='{{$user->birth}}'>
                    <label class="laydate-icon"></label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">地址：</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="address"  value="{{$user->address}}">
                    <span></span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">喜爱的球队：</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="team"  value="{{$user->team}}">
                    <span></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">个性签名：</label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" name="signature" value="{{$user->signature}}">
                    <span></span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">自我介绍：</label>
                <div class="col-sm-5">
                    <textarea rows="3" class="form-control" name='introduction' >{{$user->introduction}}</textarea>
                </div>
            </div>
            
            <div class="form-group">
                <div class="col-sm-5 col-sm-offset-3">
                    {{csrf_field()}}
                    <button type="submit" class="btn btn-primary">提交</button>
                    <button type="reset" class="btn btn-danger">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
@endsection
@section('js')
<script src="{{asset('/HomeCss/mydata/js/plugins/layer/laydate/laydate.js')}}"></script>
    <script>
        //外部js调用
        laydate({
            elem: '#hello', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
            event: 'focus' //响应事件。如果没有传入event，则按照默认的click
        });

        //日期范围限制
        var start = {
            elem: '#start',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(), //设定最小日期为当前日期
            max: '2099-06-16 23:59:59', //最大日期
            istime: true,
            istoday: false,
            choose: function (datas) {
                end.min = datas; //开始日选好后，重置结束日的最小日期
                end.start = datas //将结束日的初始值设定为开始日
            }
        };
        var end = {
            elem: '#end',
            format: 'YYYY/MM/DD hh:mm:ss',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
                start.max = datas; //结束日选好后，重置开始日的最大日期
            }
        };
        laydate(start);
        laydate(end);
    </script>

@endsection